<template>
	<view>
		<view class="article-main">
			<view class="title">{{articleInfo.title}}</view>
			<view class="author">{{articleInfo.author}}</view>
			<view class="time">时间:{{articleInfo.createTime}}</view>
			<view class="summary">{{articleInfo.summary}}</view>
			<image :src="articleInfo.coverImg" mode=""></image>
			<view v-html="articleInfo.content1"></view>
		</view>
	</view>
</template>

<script>
	import { productArticle } from "../../../api/find/articleDetail/articleDetail.js"
	export default {
		data() {
			return {
				articleInfo:{}
			};
		},
		methods:{
			init(id){
				productArticle(id).then(res=>{
					console.log(res);
					this.articleInfo = res.data.productArticle;
					//设置导航栏文字
					uni.setNavigationBarTitle({
					title: this.articleInfo.title //这是修改后的导航栏文字
					})
				})
			}
		},
		onLoad(options) {
			this.init(options.id);
		}
	}
</script>

<style lang="scss" scoped>
	.article-main {
		padding: 60rpx;
		 //标题
		 .title {
			 font-size: 48rpx;
			 font-weight: 700;
		 }
		 //作者,时间
		 .author , .time{
			 text-align: right;
			 color: rgb(51, 51, 51);
		 }
		 //图片
		 image {
			 width: 100%;
			 margin: 30rpx auto;
			 height: 480rpx;
		 }
	}
</style>
